﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace RedBit.UserVoice.Model
{
    public class UVSuggestion : INotifyPropertyChanged
    {
        //TODO: Fill the rest of this object out.

        private int m_Id;
        public int Id
        {
            get { return m_Id; }
            set
            {
                if (value != m_Id)
                {
                    m_Id = value;
                    NotifyPropertyChanged("Id");
                }
            }
        }

        private string m_Title;
        public string Title
        {
            get { return m_Title; }
            set
            {
                if (value != m_Title)
                {
                    m_Title = value;
                    NotifyPropertyChanged("Title");
                }
            }
        }

        private DateTime m_CreatedAt;
        public DateTime CreatedAt
        {
            get { return m_CreatedAt; }
            set
            {
                if (value != m_CreatedAt)
                {
                    m_CreatedAt = value;
                    NotifyPropertyChanged("CreatedAt");
                }
            }
        }

        private string m_Text;
        public string Text
        {
            get { return m_Text; }
            set
            {
                if (value != m_Text)
                {
                    m_Text = value;
                    NotifyPropertyChanged("Text");
                }
            }
        }

        private int m_VoteCount;
        public int VoteCount
        {
            get { return m_VoteCount; }
            set
            {
                if (value != m_VoteCount)
                {
                    m_VoteCount = value;
                    NotifyPropertyChanged("VoteCount");
                }
            }
        }

        private int m_CommentCount;
        public int CommentCount
        {
            get { return m_CommentCount; }
            set
            {
                if (value != m_CommentCount)
                {
                    m_CommentCount = value;
                    NotifyPropertyChanged("CommentCount");
                }
            }
        }

        private string m_Status;
        public string Status
        {
            get { return m_Status; }
            set
            {
                if (value != m_Status)
                {
                    m_Status = value == null ? "new" : value;
                    NotifyPropertyChanged("Status");
                }
            }
        }


        private string m_Category;
        public string Category
        {
            get { return m_Category; }
            set
            {
                if (value != m_Category)
                {
                    m_Category = value;
                    NotifyPropertyChanged("Category");
                }
            }
        }

        private string m_ForumId;
        public string ForumId
        {
            get { return m_ForumId; }
            set
            {
                if (value != m_ForumId)
                {
                    m_ForumId = value;
                    NotifyPropertyChanged("ForumId");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string property)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(property));
        }
    }

    public enum UVSuggestionFilter
    {
        All,
        Published,
        Inbox,
        Active,
        Closed,
        Deleted,
        Spam,
        Merged
    }

    public enum UVSuggestionSort
    {
        Votes,
        Hot,
        Oldest,
        Newest
    }
}
